package com.ljx.itbbs.server.mq.service;

import org.springframework.amqp.core.MessagePostProcessor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: LiJunXi
 * @Description: 消息队列生产者
 * @Date: 2024-03-31  09:44
 */
@Component
public class RabbitMQProducer {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendMQMsg(String exchange, Object body) {
        rabbitTemplate.convertAndSend(exchange, body);
    }
}
